
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qdu.servlet;

import com.qdu.entity.PublicActivity;
import com.qdu.service.PublicActivityService;
import com.qdu.service.impl.PublicActivityServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Daniel
 */
@WebServlet("/gabns")
public class GetActivityByNameServlet extends HttpServlet{
    
    PublicActivityService pas=new PublicActivityServiceImpl();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        String Ptopic= req.getParameter("keyword");
        List<PublicActivity> list = pas.findPublicActivityByKeyword(Ptopic);
        req.setAttribute("pa_list", list);
        req.getRequestDispatcher("/Search.jsp").forward(req, resp);
    }
    
}
